package com.wsl.demo;

import org.jasypt.util.text.BasicTextEncryptor;

public class Jasypt {

    public static void main(String[] args) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        // 加密密钥
        textEncryptor.setPassword("666");
        // 要加密的数据（如数据库的用户名或密码）
        String username = textEncryptor.encrypt("root");
        String password = textEncryptor.encrypt("123");
        System.out.println("加密：username:" + username);
        System.out.println("加密：password:" + password);
    }


}
